#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int a = 5;
	int b = 7;
	
	
	return 0;
}
int main()
{
    int i = 0;
    int j = 0;
    int n = 0;
    int m = 0;
    int arr[10][10] = { 0 };
    int sum = 0;
    scanf("%d %d", &n, &m);
    for (i = 0; i < n; i++)
    {
        for (j = 0; j < m; j++)
        {
            scanf("%d ", &arr[i][j]);
            if (arr[i][j] > 0)
            {
                sum += arr[i][j];
            }
        }
    }
    printf("%d\n", sum);
    return 0;
}

int main()
{
    int i = 0;
    int n = 0;
    int arr[20][20] = { 0 };
    int s = 0;
    int count = 0;
    scanf("%d", &n);
    int f = n - 1;
    while (count < n * n)
    {
        for (i = s; i <= f; i++)
        {
            arr[s][i] = ++count;
        }
        for (i = s + 1; i <= f; i++)
        {
            arr[i][f] = ++count;
        }
        for (i = f - 1; i >= s; i--)
        {
            arr[f][i] = ++count;
        }
        for (i = f - 1; i >= s + 1; i--)
        {
            arr[i][s] = ++count;
        }
        s++;
        f--;
    }
    for (i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            printf("%d ", arr[i][j]);
        }
        printf("\n");
    }
    return 0;
}

int main()
{
    int n = 0;
    int i = 0;
    int j = 0;
    int count = 0;
    int sum = 1;
    int arr[20][20] = { 0 };
    scanf("%d", &n);
    while (count <= 2 * n - 2)
    {
        for (i = 0; i < n; i++)
        {
            for (j = 0; j < n; j++)
            {
                if (i + j == count)
                {

                    if (count % 2 == 0)
                    {
                        arr[j][i] = sum++;
                    }
                    else
                    {
                        arr[i][j] = sum++;
                    }
                }
            }
        }
        count++;
    }
    for (i = 0; i < n; i++)
    {
        for (j = 0; j < n; j++)
        {
            printf("%d ", arr[i][j]);
        }
        printf("\n");
    }
    return 0;
}

int main()
{
    int i = 0;
    int j = 0;
    int n = 0;
    int m = 0;
    int arr1[100][100] = { 0 };
    int arr2[100][100] = { 0 };
    double count = 0;
    double sum = 0;
    scanf("%d %d", &n, &m);
    for (i = 0; i < m; i++)
    {
        for (j = 0; j < n; j++)
        {
            scanf("%d ", &arr1[i][j]);
        }
    }
    for (i = 0; i < m; i++)
    {
        for (j = 0; j < n; j++)
        {
            scanf("%d ", &arr2[i][j]);
        }
    }
    for (i = 0; i < m; i++)
    {
        for (j = 0; j < n; j++)
        {
            if (arr1[i][j] == arr2[i][j])
            {
                count++;
            }
        }
    }
    printf("%.2lf\n", count / (n * m) * 100);
    return 0;
}

int main()
{
    int i = 0;
    int j = 0;
    int n = 0;
    int sum = 0;
    int arr[10][10] = { 0 };
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        for (j = 0; j < n; j++)
        {
            scanf("%d ", &arr[i][j]);
        }
    }
    for (i = 1; i < n; i++)
    {
        for (j = 0; j < i; j++)
        {
            sum += arr[i][j];
        }
    }
    if (sum == 0)
    {
        printf("YES\n");
    }
    else {
        printf("NO\n");
    }
    return 0;
}